<template>
  <div>
    <div class="container-menu">
      <nav class="mainmenu">
        <ul>
          <li>
            <a class="fg-bgc" href="javascript:void(0);" @click="change(0)">
              <span class="img-menu" id="about-ico"></span>
              <span class="txt-menu">关于我</span>
            </a>
          </li>
          <li>
            <a class="fg-bgc" href="javascript:void(0);" @click="change(1)">
              <span class="img-menu" id="resume-ico"></span>
              <span class="txt-menu">个人简历</span>
            </a>
          </li>
          <li>
            <a class="fg-bgc" href="javascript:void(0);" @click="change(2)">
              <span class="img-menu" id="portfolio-ico"></span>
              <span class="txt-menu">作品展示</span>
            </a>
          </li>
          <li>
            <a class="fg-bgc" href="javascript:void(0);" @click="change(3)">
              <span class="img-menu" id="contact-ico"></span>
              <span class="txt-menu">联系方式</span>
            </a>
          </li>
          <li>
            <a class="fg-bgc" href="javascript:void(0);" @click="change(4)">
              <span class="img-menu" id="other-ico"></span>
              <span class="txt-menu">其他</span>
            </a>
          </li>
        </ul>
      </nav>
    </div>
  </div>
</template>

<script>
  import eventHub from '../assets/eventHub'
  export default{
    name: 'nav-menu',
    methods:{
        change:function (i) {
          eventHub.$emit('viewchange',i)
        }
    }
  }
</script>

<style>
  .container-menu {
    position: fixed;
    top: 50%;
    right: 0;
    margin-top: -170px;
    z-index: 1000;
  }

  .mainmenu {
    margin: 0 auto;
  }

  .mainmenu ul {
    list-style-type: none;
  }

  .mainmenu li {
    width: 195px;
    margin: 7px 0 0 0;
    position: relative;
    right: -140px;
    z-index: 100;
    transition: right .5s ease-in-out ;
  }
  .mainmenu li:hover{
    right: 0px !important;
  }
  .mainmenu li a {
    cursor: pointer;
    display: block;
    height: 55px;
    text-align: left;
    text-decoration: none;
    font-family: arial, sans-serif;
    font-size: 17px;
    font-weight: bold;
    color: #fff;
    opacity: 0.95;
    -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95);
    filter: alpha(opacity=95);
    -webkit-border-radius: 10px 0px 0px 10px;
    border-radius: 10px 0px 0px 10px;
    padding-top: 1px;
    /*background-image: url("images/title-bg.png");*/
    background-color: indigo;
  }

  .mainmenu li a span.img-menu {
    display: block;
    width: 40px;
    height: 40px;
    margin: 11px 0 0 12px;
    float: left;
    background: url("/static/img/menu_sprite.png") no-repeat;
  }

  #about-ico {
    background-position: -78px 0;
  }

  #resume-ico {
    background-position: -390px -155px;
  }

  #portfolio-ico {
    background-position: -232px -80px;
  }

  #contact-ico {
    background-position: -388px 0;
  }

  #other-ico {
    background-position: -454px 0;
  }

  .mainmenu li .txt-menu {
    display: block;
    margin: 14px 10px 0 60px;
    letter-spacing: 1px;
    font-size: 20px;
  }
</style>
